package com.base.logistics.sf.bean.order;

import com.base.logistics.utils.SfGsonBuilder;

import java.io.Serializable;

/**
 * <pre>
 * 订单结果查询请求对象
 * </pre>
 * @since 2021-02-14
 */
public class OrderRespRequest implements Serializable {

    /**
     * 接口服务代码
     */
    private static final String SERVICE_CODE = "EXP_RECE_SEARCH_ORDER_RESP";

    /**
     * 语言(返回描述语)
     * <pre>
     * 是否必填： 是
     * </pre>
     */
    private String language;

    /**
     * 客户订单号
     * <pre>
     * 是否必填： 是
     * </pre>
     */
    private String orderId;


    /**
     * 查询类型：1.正向单查询，传入的orderId为正向订单号，2.退货单查询，传入的orderId为退货原始订单号
     * <pre>
     * 是否必填： 否
     * 默认值： 1
     * </pre>
     */
    private String searchType;

    OrderRespRequest(String language, String orderId, String searchType) {
        this.language = language;
        this.orderId = orderId;
        this.searchType = searchType;
    }

    public static OrderRespRequestBuilder builder() {
        return new OrderRespRequestBuilder();
    }


    /**
     * 获取接口服务代码
     * @return 接口服务代码
     */
    public String getServiceCode(){
        return SERVICE_CODE;
    }

    /**
     * 转json
     * @return json数据
     */
    public String toJson() {
        return SfGsonBuilder.create().toJson(this);
    }

    public String getLanguage() {
        return this.language;
    }

    public String getOrderId() {
        return this.orderId;
    }

    public String getSearchType() {
        return this.searchType;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public void setSearchType(String searchType) {
        this.searchType = searchType;
    }


    public static class OrderRespRequestBuilder {
        private String language;
        private String orderId;
        private String searchType;

        OrderRespRequestBuilder() {
        }

        public OrderRespRequestBuilder language(String language) {
            this.language = language;
            return this;
        }

        public OrderRespRequestBuilder orderId(String orderId) {
            this.orderId = orderId;
            return this;
        }

        public OrderRespRequestBuilder searchType(String searchType) {
            this.searchType = searchType;
            return this;
        }

        public OrderRespRequest build() {
            return new OrderRespRequest(language, orderId, searchType);
        }

    }
}
